package com.jt.service;

import com.jt.dao.DeptMapper;
import com.jt.pojo.Dept;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DeptServiceImpl implements DeptService{
    @Autowired
    private DeptMapper deptMapper;

    @Override
    public List<Dept> getAll() {
        return deptMapper.selectList(null);
    }

    @Override
    public void deleteDept(Integer id) {
        deptMapper.deleteById(id);
    }

    @Override
    public void saveDept(Dept dept) {
        deptMapper.insert(dept);
    }

    @Override
    public void updateDept(Dept dept) {
        deptMapper.updateById(dept);

    }
}
